"""


"""
from rest_framework import serializers

from users.models import User


class UserSerializer(serializers.ModelSerializer):

    class Meta:
        model = User
        fields = ("id", "username", "mobile", "email")


class UserAddSerialier(serializers.ModelSerializer):

    class Meta:
        model = User
        fields = ("username", "mobile", "password", "email")

        extra_kwargs = {
            "password":{
                "write_only":True
            }
        }

    def create(self, validated_data):
        return User.objects.create_user(**validated_data)